import { Component, Vue, Watch } from 'vue-property-decorator'
import { AppModule } from '@/store/modules/app'
import { DataType, EnumBaseValue } from '@/config/PageConfig'
import typeOfUtils from '@/utils/type-of-utils'

@Component({})
export default class DataTypeMixin extends Vue {
  public get dataType() {
    return AppModule.dataType
  }

  @Watch('dataType')
  public dataTypeWatch(value: string) {
    if (DataType.MYSQL.value === value) {
      this.dataTypeOptions(DataType.MYSQL.fieldOptions)
    } else if (DataType.ORACLE.value === value) {
      this.dataTypeOptions(DataType.ORACLE.fieldOptions)
    }
  }

  public dataTypeOptions(options: EnumBaseValue[]) {

  }

  created() {
    this.dataTypeWatch(this.dataType)
  }

  mounted() {
    this.dataTypeWatch(this.dataType)
  }
}
